package com.moefor.clover.model;

import java.util.Date;

import javax.persistence.*;

@Entity
public class Message extends BaseEntity{
	
	@JoinColumn(nullable = false)
	@ManyToOne(cascade = {CascadeType.ALL})
	private User sender;
	
	@JoinColumn(nullable = false)
	@ManyToOne(cascade = {CascadeType.ALL})
	private User receiver;
	
	@Column(nullable = false)
	private String content;
	
	@Column(nullable = false)
	private Date date;
	
	@Column(nullable = false)
	private Boolean isRead;

	public User getSender() {
		return sender;
	}

	public void setSender(User sender) {
		this.sender = sender;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public User getReceiver() {
		return receiver;
	}

	public void setReceiver(User receiver) {
		this.receiver = receiver;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Boolean getIsRead() {
		return isRead;
	}

	public void setIsRead(Boolean isRead) {
		this.isRead = isRead;
	}
}